import request from '@/utils/request'

// 查询配图管理列表
export function listMapping(query) {
  return request({
    url: '/activities/mapping/list',
    method: 'get',
    params: query
  })
}

// 查询配图管理详细
export function getMapping(mappingId) {
  return request({
    url: '/activities/mapping/' + mappingId,
    method: 'get'
  })
}

// 新增配图管理
export function addMapping(data) {
  return request({
    url: '/activities/mapping',
    method: 'post',
    data: data
  })
}

// 处理图片上传
export function uploadImage(formData) {
  return request({
    url: '/activities/mapping/upload',  // 图片上传的接口
    method: 'post',
    headers: {
      'Content-Type': 'multipart/form-data'
    },
    data: formData
  })
}


// 修改配图管理
export function updateMapping(data) {
  return request({
    url: '/activities/mapping',
    method: 'put',
    data: data
  })
}

// 删除配图管理
export function delMapping(mappingId) {
  return request({
    url: '/activities/mapping/' + mappingId,
    method: 'delete'
  })
}
